package com.example.hello;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

public class UserCenterActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_center);

        //设置隐藏头部标题栏
        ActionBar bar = getSupportActionBar();
        if(null != bar){
            bar.hide();
        }

//        //获取聊天菜单组件
//        LinearLayout talkLL = findViewById(R.id.talkLL);
//        //给talkLL添加点击事件
//        talkLL.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                //跳转聊天界面
//                Intent intent = new Intent(UserCenterActivity.this, TalkActivity.class);
//                startActivity(intent);
//
//            }
//        });

        //获取聊天菜单布局组件
        LinearLayout talkLL = findViewById(R.id.talkLL);
        //获取翻译菜单布局组件
        LinearLayout translationLL = findViewById(R.id.translationLL);
        //给talkLL添加点击监听事件
        talkLL.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到聊天界面
                Intent intent = new Intent(UserCenterActivity.this, TalkActivity.class);
                startActivity(intent);
            }
        });

        //给translationLL添加点击监听事件
        translationLL.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //跳转到翻译界面
                Intent intent = new Intent(UserCenterActivity.this, TranslationActivity.class);
                startActivity(intent);
            }
        });

    }
}
